<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:77:"D:\phpstudy_pro\WWW\nmg001\public/../application/admin\view\applys\lists.html";i:1657873828;}*/ ?>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> <?php echo $setting['webname']; ?>- 报名记录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/public/static/favicon.ico"> <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/footable/footable.core.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">


</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>报名记录</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="<?php echo url('Admins/admin'); ?>">主页</a>
                </li>
                <li>
                    <strong>报名列表</strong>
                </li>
            </ol>
        </div>
        <div class="col-sm-8" style="text-align: right;line-height: 15px;margin-top:25px;">

        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeIn">
        <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs" id="table-title">
                        <?php foreach($list as $v): ?>
                            <li id="type<?php echo $v['id']; ?>" data-id="<?php echo $v['id']; ?>"><a data-toggle="tab" href="#tab-<?php echo $v['id']; ?>"  aria-expanded="true"> <?php echo $v['type_name']; ?>(<?php echo $v['length']; ?>)</a></li>
                        <?php endforeach; ?>
                    </ul>
                    <div class="tab-content">
                        <?php foreach($list as $v): ?>
                        <!--新闻列表开始-->
                        <div id="tab-<?php echo $v['id']; ?>" class="tabs">
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table class="footable table table-stripped toggle-arrow-tiny table-hover" data-page-size="15">


                                        <thead>
                                        <tr>
                                            <th data-toggle="true">姓名</th>
                                            <th>年级</th>
                                            <th>电话</th>
                                            <th>父母电话</th>
                                            <th>报考类别</th>
                                            <th>专业1</th>
                                            <th>专业2</th>
                                            <th>服从调剂</th>
                                            <?php if($v['id']!=5): ?>
                                            <th>负责老师</th>
                                            <?php endif; ?>
                                            <th>报名时间</th>
                                            <th>状态</th>
                                            <?php if($v['id']==2 || $v['id'] == 4): ?>
                                            <th>通知书编号</th>
                                            <?php endif; if($v['id']==1 || $v['id']==5 || $v['id']==2 || $v['id'] == 4): ?>
                                              <th>操作</th>
                                            <?php endif; ?>
                                            <th data-hide="all">学员ID号</th>
                                            <th data-hide="all">性别</th>
                                            <th data-hide="all">民族</th>
                                            <th data-hide="all">qq/微信</th>
                                            <th data-hide="all">毕业学校所在地</th>
                                            <th data-hide="all">学校名称</th>
                                            <th data-hide="all">中考（模拟）成绩</th>
                                            <th data-hide="all">身份证号</th>
                                            <th data-hide="all">通讯地址</th>
                                            <th data-hide="all">报名修改时间</th>
                                            <th data-hide="all">支付类型</th>
                                            <th data-hide="all">支付账号</th>
                                            <th data-hide="all">支付时间</th>
                                            <th data-hide="all">备注</th>
                                            <th <?php if($v['id']!=3): ?>data-hide="all"<?php endif; ?>>拒绝理由</th>
                                            <?php if($v['id']==3): ?>
                                            <th>操作</th>
                                            <?php endif; ?>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <?php if(array_key_exists('newslist',$v)): ?>
                                        <tr>
                                            <td colspan="11">暂无数据</td>
                                        </tr>
                                        <?php endif; foreach($v['newslist'] as $vs): ?>
                                            <!--行开始-->
                                            <tr>
                                                <td><?php echo $vs['userinfo']['name']; ?></td>
                                                <td><?php echo $vs['userinfo']['grade']; ?></td>
                                                <td><?php echo $vs['userinfo']['phone']; ?></td>
                                                <td><?php echo $vs['userinfo']['parenttel']; ?></td>
                                                <td><?php echo $vs['bktype']; ?></td>
                                                <td><?php echo $vs['major']; ?></td>
                                                <td><?php echo $vs['major2']; ?></td>
                                                <td><?php echo $vs['isadjust']; ?></td>
                                                <?php if($v['id']!=5): ?>
                                                <td><?php echo $vs['teacher']; ?></td>
                                                <?php endif; ?>
                                                <td><?php echo $vs['create_time']; ?></td>
                                                <td>
                                                    <?php if($vs['status']==1): ?>
                                                    <span style="color:#f8ac59"><i class="fa fa-thumb-tack"></i> 缴费核对中</span>
                                                    <?php elseif($vs['status']==2): ?>
                                                    <span style="color:green"><i class="fa fa-check"></i> 已录取</span>
                                                    <?php elseif($vs['status']==3): ?>
                                                    <span style="color:#d9534f;"><i class="fa fa-times"></i> 拒绝</span>
                                                    <?php elseif($vs['status']==4): ?>
                                                    <span style="color:#19a9d5;"><i class="fa fa-times"></i> 待支付</span>
                                                    <?php elseif($vs['status']==5): ?>
                                                    <span style="color:#f8ac59;"><i class="fa fa-thumb-tack"></i> 报名核对中</span>
                                                    <?php endif; ?>
                                                </td>
                                                <?php if($v['id']==2 || $v['id'] == 4): ?>
                                                <td><?php echo $vs['advice_note']; ?></td>
                                                <?php endif; ?>
                                                <!--缴费核对-->
                                                <?php if($v['id']==1): ?>
                                                <td class="tools">
                                                    <!--待支付-->
                                                    <a class="rotate" data-username="<?php echo $vs['userinfo']['name']; ?>" data-id="<?php echo $vs['id']; ?>"><i class="fa fa-rotate-left" style="color:#19a9d5" data-type="<?php echo $vs['type']; ?>"></i></a>
                                                    <!--录取-->
                                                    <a class="check"  data-username="<?php echo $vs['userinfo']['name']; ?>" data-courses="" data-times="<?php echo $vs['create_time']; ?>" data-id="<?php echo $vs['id']; ?>" data-type="<?php echo $vs['type']; ?>" data-idcard="<?php echo $vs['userinfo']['idcard']; ?>" data-bktype="<?php echo $vs['bktype']; ?>" data-major="<?php echo $vs['major']; ?>" data-major2="<?php echo $vs['major2']; ?>" data-isadjust="<?php echo $vs['isadjust']; ?>" data-paytype="<?php echo $vs['paytype']; ?>" data-teacher="<?php echo $vs['teacher']; ?>" data-paytime="<?php if($vs['pay_time'] !=''): ?><?php echo date('Y-m-d H:i:s',$vs['pay_time']); endif; ?>" data-payid="<?php echo $vs['payid']; ?>"><i class="fa fa-check" style="color:#79c667"></i></a>
                                                    <a class="del" data-id="<?php echo $vs['id']; ?>" data-type="<?php echo $vs['type']; ?>"><i class="fa fa-trash" style="color:#cacfd3"></i></a>
                                                </td>
                                                <!--报名信息审核-->
                                                <?php elseif($v['id']==5): ?>
                                                <td class="tools">
                                                    <!--确认报名信息通过-->
                                                    <a class="pass"  data-username="<?php echo $vs['userinfo']['name']; ?>" data-courses="" data-times="<?php echo $vs['create_time']; ?>" data-id="<?php echo $vs['id']; ?>" data-type="<?php echo $vs['type']; ?>" data-idcard="<?php echo $vs['userinfo']['idcard']; ?>" data-bktype="<?php echo $vs['bktype']; ?>" data-major="<?php echo $vs['major']; ?>" data-teacher="<?php echo $vs['teacher']; ?>"  data-major2="<?php echo $vs['major2']; ?>" data-isadjust="<?php echo $vs['isadjust']; ?>" ><i class="fa fa-check-square-o" style="color:#79c667"></i></a>
                                                    <a class="times" data-id="<?php echo $vs['id']; ?>" data-type="<?php echo $vs['type']; ?>"><i class="fa fa-times" style="color:#d9534f"></i></a>
                                                    <a class="del" data-id="<?php echo $vs['id']; ?>" data-type="<?php echo $vs['type']; ?>"><i class="fa fa-trash" style="color:#cacfd3"></i></a>
                                                </td>
                                                <?php elseif($v['id']==2): ?>
                                                <td class="tools">
                                                    <!--待支付-->
                                                    <a href="<?php echo url('Applys/update_major'); ?>?id=<?php echo $vs['id']; ?>&pid=<?php echo $v['id']; ?>"><i class="fa fa-pencil" style="color:#19a9d5" data-type="<?php echo $vs['type']; ?>"></i></a>
                                                    <a class="del" data-id="<?php echo $vs['id']; ?>" data-type="<?php echo $vs['type']; ?>"><i class="fa fa-trash" style="color:#cacfd3"></i></a>
                                                    <a class="print" title="专业1" data-name="<?php echo $vs['userinfo']['name']; ?>" data-id="<?php echo $vs['userinfo']['id']; ?>" data-applyid="<?php echo $vs['id']; ?>" data-pid="<?php echo $v['id']; ?>"><i class="fa fa-print" style="color:#000000" data-type="<?php echo $vs['type']; ?>"></i></a>
                                                    <a class="print2" title="专业2" data-name="<?php echo $vs['userinfo']['name']; ?>" data-id="<?php echo $vs['userinfo']['id']; ?>" data-applyid="<?php echo $vs['id']; ?>" data-pid="<?php echo $v['id']; ?>"><i class="fa fa-print" style="color:#0b4cb2" data-type="<?php echo $vs['type']; ?>"></i></a>
                                                </td>
                                                <?php elseif($v['id']==4): ?>
                                                <td class="tools">
                                                    <a href="<?php echo url('Applys/update_major'); ?>?id=<?php echo $vs['id']; ?>&pid=<?php echo $v['id']; ?>"><i class="fa fa-pencil" style="color:#19a9d5" data-type="<?php echo $vs['type']; ?>"></i></a>
                                                    <a class="print" data-name="<?php echo $vs['userinfo']['name']; ?>" data-id="<?php echo $vs['userinfo']['id']; ?>" data-applyid="<?php echo $vs['id']; ?>" data-pid="<?php echo $v['id']; ?>"><i class="fa fa-print" style="color:#000000" data-type="<?php echo $vs['type']; ?>"></i></a>
                                                    <a class="del" data-id="<?php echo $vs['id']; ?>" data-type="<?php echo $vs['type']; ?>"><i class="fa fa-trash" style="color:#cacfd3"></i></a>
                                                </td>
                                                <?php endif; ?>
                                                <!--隐藏起来的列表信息-->
                                                <td><?php echo $vs['userinfo']['id']; ?></td>
                                                <td><?php if($vs['userinfo']['sex'] === 1): ?>男<?php elseif($vs['userinfo']['sex'] === 0): ?>女<?php else: ?>不详<?php endif; ?></td>
                                                <td><?php echo $vs['userinfo']['nation']; ?></td>
                                                <td><?php echo $vs['userinfo']['qqwx']; ?></td>
                                                <td><?php echo $vs['userinfo']['schooladdress']; ?></td>
                                                <td><?php echo $vs['userinfo']['schoolname']; ?></td>
                                                <td><?php echo $vs['userinfo']['score']; ?></td>
                                                <td><?php echo $vs['userinfo']['idcard']; ?></td>
                                                <td><?php echo $vs['userinfo']['address']; ?></td>
                                                <td><?php echo $vs['update_time']; ?></td>
                                                <td><?php echo $vs['paytype']; ?></td>
                                                <td><?php echo $vs['payid']; ?></td>
                                                <td><?php echo date('Y-m-d H:i:s',$vs['pay_time']); ?></td>
                                                <td><?php if(empty($vs['comment'])): ?>无<?php else: ?><?php echo $vs['comment']; endif; ?></td>
                                                <td><?php if(empty($vs['reason'])): ?>无<?php else: ?><?php echo $vs['reason']; endif; ?></td>
                                                <?php if($v['id']==3): ?>
                                                <td class="tools">

                                                    <a class="del" data-id="<?php echo $vs['id']; ?>" data-type="<?php echo $vs['type']; ?>"><i class="fa fa-trash" style="color:#cacfd3"></i></a>
                                                </td>
                                                <?php endif; ?>
                                            </tr>
                                        <!--行结束-->
                                        <?php endforeach; ?>
                                        </tbody>
                                        <tfoot>
                                        <tr>
                                            <td colspan="9">
                                                <ul class="pagination pull-left"></ul>
                                                <?php if($v['id']==2): ?>
                                                <div>
                                                    <a href="<?php echo url('Applys/lqExcel'); ?>">
                                                        <button class="btn btn-info btn-sm btn-block" style="width: 110px;margin-left: 10px;display: inline-block;">下载已录取名单</button>
                                                    </a>
                                                </div>
                                                <?php elseif($v['id']==4): ?>
                                                <div>
                                                    <a href="<?php echo url('Applys/dzfExcel'); ?>">
                                                        <button class="btn btn-info btn-sm btn-block" style="width: 110px;margin-left: 10px;display: inline-block;">下载待交付名单</button>
                                                    </a>
                                                </div>
                                                <?php endif; ?>
                                            </td>
                                        </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 列表结束 -->
                        <?php endforeach; ?>
                    </div>
                </div>
            </div>
        </div>
       
    </div>
    <!--弹出层-->
    <style>
        .layer_notice{
            width: 90%;
            margin:10px auto;
            line-height: 30px;
            display: none;
        }
        .layer_notice select{
            height: 35px;
        }
    </style>
    <!--录取通过-->
    <div class="layer_notice" id="check">
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">姓名：</label>
            <div class="col-sm-7 col-sm-7" id="usernames"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">身份证号：</label>
            <div class="col-sm-7 col-sm-7" id="idcard"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">报考类型：</label>
            <div class="col-sm-7 col-sm-7" id="bktype"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">专业1：</label>
            <div class="col-sm-7 col-sm-7" id="major"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">专业2：</label>
            <div class="col-sm-7 col-sm-7" id="major22"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">服从调剂：</label>
            <div class="col-sm-7 col-sm-7" id="isadjust"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">支付类型：</label>
            <div class="col-sm-7 col-sm-7" id="paytype"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">支付账号：</label>
            <div class="col-sm-7 col-sm-7" id="payid"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">支付时间：</label>
            <div class="col-sm-7 col-sm-7" id="paytime"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">报名时间：</label>
            <div class="col-sm-7 col-sm-7" id="times"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">负责老师：</label>
            <div class="col-sm-7 col-sm-7" id="teacher_m"></div>
        </div>
        <div class="row">
            <div class="col-sm-12" style="text-align: right;">
                <button class="btn closes">取消</button>
                <button class="btn btn-info" id="classAddStudent">通过</button>
            </div>
        </div>
    </div>
    <!--信息审核-->
    <div class="layer_notice" id="pass">
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">姓名：</label>
            <div class="col-sm-7 col-sm-7" id="usernames2"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">身份证号：</label>
            <div class="col-sm-7 col-sm-7" id="idcard2"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">报考类型：</label>
            <div class="col-sm-7 col-sm-7" id="bktype2"> </div>
        </div>
        <div class="row" id="major100">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">专业1：</label>
            <div class="col-sm-7 col-sm-7" id="major2"> </div>
        </div>
        <div class="row" id="major101">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">专业2：</label>
            <div class="col-sm-7 col-sm-7" id="major222"> </div>
        </div>
        <div class="row" id="isadjust100">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">服从调剂：</label>
            <div class="col-sm-7 col-sm-7" id="isadjust2"> </div>
        </div>

        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">报名时间：</label>
            <div class="col-sm-7 col-sm-7" id="times2"> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">负责老师：</label>
            <div class="col-sm-7 col-sm-7">
                <select class="form-control" name="teacher" id="teacher" style="height: 30px;padding:3px 9px;">
                    <option value="">=选择负责老师=</option>
                    <?php foreach($teacher as $val): ?>
                    <option value="<?php echo $val['name']; ?>" data-id="<?php echo $val['id']; ?>"><?php echo $val['name']; ?></option>
                    <?php endforeach; ?>
                </select>
                <!--<input type="text" id="teacher"  placeholder="负责老师姓名" style="height: 30px;" >-->
            </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">备注：</label>
            <div class="col-sm-7 col-sm-7">
                <input type="text" id="teacher_comment" class="form-control" name="teacher_comment">
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12" style="text-align: right;">
                <button class="btn closes" >取消</button>
                <button class="btn btn-info" id="classAddStudent2">通过</button>
            </div>
        </div>
    </div>
    <!--通知书-->
    <div class="layer_notice" id="print_advice_node" style="width: 300px;height:440px">

    </div>
    <!--弹出层-->
    <!-- 全局js -->
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>

    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>

    <!-- iCheck -->
    <script src="/public/static/admin/js/plugins/iCheck/icheck.min.js"></script>
    <!-- Switchery -->
    <script src="/public/static/admin/js/plugins/switchery/switchery.js"></script>

    <!-- 自定义js -->
    <script src="/public/static/admin/js/content.js?v=1.0.0"></script>
    <script src="/public/static/admin/layui/layui.js"></script>
    <script src="/public/static/admin/js/plugins/footable/footable.all.min.js"></script>
    <script src="/public/static/admin/js/jquery.jqprint-0.3.js"></script>
    <script>
        $(document).ready(function() {
            $('.footable').footable();
            $(".tabs").attr("class","tab-pane");
            $("#type<?php echo $activeid; ?>").attr("class","active");
            $("#tab-<?php echo $activeid; ?>").attr("class","tab-pane active");
        });
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            //点击提交
            $(".del").click(function(){
                var s = $(this);
                top.layer.msg('你确定要删除？', {
                    time: 20000, //20s后自动关闭
                    shade: 0.8,
                    btn: ['确定', '取消'],
                    btn1:function(){
                        $.post("<?php echo url('Applys/deletes'); ?>",{id:s.attr('data-id'),typeid:s.attr('data-typeid')},function(data){
                            top.layer.closeAll();
                            top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                                if(data.url){
                                    window.location.href = data.url;
                                }
                            });
                        });
                    }
                });
            });
            $(".rotate").click(function(){
                var s = $(this);
                top.layer.msg('你确定要将\"'+s.data('username')+'\"的报名修改为待支付吗？', {
                    time: 20000, //20s后自动关闭
                    shade: 0.8,
                    btn: ['确定', '取消'],
                    btn1:function(){
                        $.post("<?php echo url('Applys/dzf'); ?>",{id:s.data('id'),typeid:s.data('typeid')},function(data){
                            top.layer.closeAll();
                            top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                                if(data.url){
                                    window.location.href = data.url;
                                }
                            });
                        });
                    }
                });
            });
            //拒绝
            $(".times").click(function(){
                var s = $(this);
                layer.prompt({title: '请输入拒绝理由', formType: 2}, function(text){
                       if(text != "") {
                           $.post("<?php echo url('Applys/times'); ?>", {
                               reason: text,
                               id: s.attr('data-id'),
                               typeid: s.attr('data-typeid')
                           }, function (data) {
                               top.layer.closeAll();
                               top.layer.msg(data.msg, {time: 2000,shade:0.5}, function () {
                                   if (data.url) {
                                       window.location.href = data.url;
                                   }
                               });
                           });
                       }
                });
            });
            //确认支付
            $(".check").click(function(){
                var s = $(this);
                $("#usernames").text(s.data("username"));
                $("#idcard").text(s.data("idcard"));
                $("#bktype").text(s.data("bktype"));
                $("#major").text(s.data("major"));
                $("#major22").text(s.data("major2"));
                $("#isadjust").text(s.data("isadjust"));
                $("#teacher_m").text(s.data("teacher"));
                $("#classAddStudent").attr("data-id",s.data("id"));
                if(s.data("paytype") == "微信") {
                    $("#paytype").html("<span style='color:green'>微信</span>");
                    $("#payid").html("<span style='color:green'>"+s.data("payid")+"</span>");
                }else if(s.data("paytype") == "支付宝"){
                    $("#paytype").html("<span style='color:blue'>支付宝</span>");
                    $("#payid").html("<span style='color:blue'>"+s.data("payid")+"</span>");

                }
                $("#paytime").text(s.data("paytime"));
                $("#times").text(s.data("times"));
               //页面层
                layer.open({
                    type: 1,
                    skin: false, //加上边框
                    title: "确认支付信息-确定录取",
                    area: ['300px', 'AUTO'], //宽高
                    content: $("#check")  //调到新增页面
                });
            });

            //录取报名通过
            $(".pass").click(function(){
                var s = $(this);
                $("#usernames2").text(s.data("username"));
                $("#idcard2").text(s.data("idcard"));
                $("#bktype2").text(s.data("bktype"));
                if(s.data("bktype") == "职普融通班（普高部）"){
                    $("#major100").hide()
                    $("#major101").hide()
                    $("#isadjust100").hide()
                }else{
                    $("#major100").show()
                    $("#major101").show()
                    $("#isadjust100").show()
                }
                $("#major2").text(s.data("major"));
                $("#major222").text(s.data("major2"));
                $("#isadjust2").text(s.data("isadjust"));
                $("#classAddStudent2").attr("data-id",s.data("id"));
                $("#times2").text(s.data("times"));
                var teacher = s.data('teacher');
                if(teacher!=="") {
                    $("#teacher option[value="+teacher+"]").prop("selected",true);
                    // $("#teacher").prop("disabled",true);
                }else{
                    $("#teacher option:eq(0)").prop("selected",true);
                }
                //页面层
                layer.open({
                    type: 1,
                    skin: false, //加上边框
                    title: "录取通知信息",
                    area: ['300px', 'auto'], //宽高
                    content: $("#pass"),  //调到新增页面


                });
            });
            //报名信息审核通过按钮
            $("#classAddStudent2").click(function(){
                var s = $(this);
                if($("#teacher").val() == ""){
                    top.layer.msg("请输入负责老师姓名", {time: 2000,shade:0.5}, function () {
                       $("#teacher").focus();
                    });
                    return false;
                }
                var data = {
                    id: s.data('id'),
                    teacher : $("#teacher").val(),
                    teacher_id : $("#teacher option:selected").data("id"),
                    teacher_comment: $("#teacher_comment").val()
                }
                // console.log(data);
                $.post("<?php echo url('Applys/classAddStudent2'); ?>",data, function (data) {
                    layer.closeAll();
                    top.layer.msg(data.msg, {time: 2000,shade:0.5}, function () {
                        if (data.url) {
                            window.location.href = data.url;
                        }
                    });
                })
            });
            //关闭弹出层
            $(".closes").click(function(){
                layer.closeAll();
            });
            $("#classAddStudent").click(function(){
                var s = $(this);
                $.post("<?php echo url('Applys/classAddStudent'); ?>", {
                    id: s.attr('data-id'),
                }, function (data) {
                    layer.closeAll();
                    top.layer.msg(data.msg, {time: 2000,shade:0.5}, function () {
                        if (data.url) {
                            window.location.href = data.url;
                        }
                    });
                })
            });
            //打印通知书
            $(".print").on("click",function(){
                var _this = $(this)
                var _time = Date.parse( new Date() ).toString();//获取到毫秒的时间戳，精确到毫秒
                _time = _time.substr(0,10);//精确到秒

                //请求数据，生成图片
                $("#print_advice_node").empty();
                $("#print_advice_node").append($("<img src='"+"<?php echo url('applys/create_advice'); ?>"+"?id="+_this.data('id')+"&time="+_time+"' width='100%'/>"));
                //页面层
                layer.open({
                    type: 1,
                    skin: false, //加上边框
                    title: "通知书",
                    area: ['300px', 'AUTO'], //宽高
                    content: $("#print_advice_node"),  //
                    btn:['打印',"取消"],
                    yes:function(){
                        $("#print_advice_node").jqprint();
                        layer.load(1, {
                            shade: 0.5,
                            time: 3*1000,
                        });
                        setTimeout(()=> {
                            var advice_print_msg = layer.msg('打印成功后请在此处已确认【' + _this.data("name") + '】同学的通知书是否已经打印成功，如果成功请点击【成功】按钮用于保存通知书编号，如果失败需要重新打印点击【重新打印】关闭该提醒并重新点击上层弹窗的【打印】按钮再次打印。', {
                                time: 200000, //20s后自动关闭
                                shade: 0.8,
                                btn: ['成功', '重新打印'],
                                btn1: function () {
                                    $.post("<?php echo url('Applys/advice_node'); ?>", {
                                        id: _this.data('applyid'),
                                        advice_note: _time,
                                        pid: _this.data('pid')
                                    }, function (data) {
                                        layer.closeAll();
                                        layer.msg(data.msg, {time: 2000, shade: 0.5}, function () {
                                            if (data.url) {
                                                window.location.href = data.url;
                                            }
                                        });
                                    });
                                },
                                btn2: function () {
                                   layer.close(advice_print_msg)
                                }
                            });
                        },3000);
                    }
                });
            });
            $(".print2").on("click",function(){
                var _this = $(this)
                var _time = Date.parse( new Date() ).toString();//获取到毫秒的时间戳，精确到毫秒
                _time = _time.substr(0,10);//精确到秒

                //请求数据，生成图片
                $("#print_advice_node").empty();
                $("#print_advice_node").append($("<img src='"+"<?php echo url('applys/create_advice2'); ?>"+"?id="+_this.data('id')+"&time="+_time+"' width='100%'/>"));
                //页面层
                layer.open({
                    type: 1,
                    skin: false, //加上边框
                    title: "通知书",
                    area: ['300px', 'AUTO'], //宽高
                    content: $("#print_advice_node"),  //
                    btn:['打印',"取消"],
                    yes:function(){
                        $("#print_advice_node").jqprint();
                        layer.load(1, {
                            shade: 0.5,
                            time: 3*1000,
                        });
                        setTimeout(()=> {
                            var advice_print_msg = layer.msg('打印成功后请在此处已确认【' + _this.data("name") + '】同学的通知书是否已经打印成功，如果成功请点击【成功】按钮用于保存通知书编号，如果失败需要重新打印点击【重新打印】关闭该提醒并重新点击上层弹窗的【打印】按钮再次打印。', {
                                time: 200000, //20s后自动关闭
                                shade: 0.8,
                                btn: ['成功', '重新打印'],
                                btn1: function () {
                                    $.post("<?php echo url('Applys/advice_node'); ?>", {
                                        id: _this.data('applyid'),
                                        advice_note: _time,
                                        pid: _this.data('pid')
                                    }, function (data) {
                                        layer.closeAll();
                                        layer.msg(data.msg, {time: 2000, shade: 0.5}, function () {
                                            if (data.url) {
                                                window.location.href = data.url;
                                            }
                                        });
                                    });
                                },
                                btn2: function () {
                                    layer.close(advice_print_msg)
                                }
                            });
                        },3000);
                    }
                });
            });
        });
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });
        //状态的切换按钮的初始化样式
        var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
        elems.forEach(function(html) {
            var switchery = new Switchery(html,{ size: 'small' });
        });
        //修改状态
        $(".js-switch").change(function(){
            var checkedS = $(this).is(":checked");
            var ids = $(this).attr("data-id");
            var st = "";
            var str = "";
            if(checkedS){
                st = 1;
                str = "显示";
            }else{
                st = 2;
                str = "隐藏";
            }
            $.post("<?php echo url('Users/setStatus'); ?>",{id:ids,status:st},function(data){

                layer.msg(str+data.msg,{time:2000});
            });
        });
    </script>

    
    

</body>

</html>
